/*
 * encoder.c
 *
 * Created: 21.06.2013 14:06:13
 *  Author: saenko
 */
#include <avr/io.h>
#include <avr/interrupt.h>

volatile uint8_t encoder_temp;


volatile uint8_t enc_left;
volatile uint8_t enc_right;


ISR(INT0_vect)
{
	
	
	if(bit_is_set(PIND,PD3)) enc_left=1;
	else enc_right = 1;


}





void encoder_init(void)
{
	EIMSK = _BV(INT0);
	EICRA = _BV(ISC01);
	
	PORTD = _BV(PD2)|_BV(PD3);
}